package com.xingkeduo.model.vo;

import com.xingkeduo.model.po.TStoreWorkPlan;
import org.springframework.util.StringUtils;

import java.text.SimpleDateFormat;

/**
 * @Author: 中文输入法发挥不稳定的刘川
 * @Date: 19-3-12 下午4:09
 */
public class StorePlanVo {

    private Long id;

    private Long storeId;

    private Long storeCode;

    private String morningShiftStartTime;

    private String morningShiftEndTime;

    private String nightShiftStartTime;

    private String nightShiftEndTime;

    private String allDayShiftStartTime;

    private String allDayShiftEndTime;

    public StorePlanVo(TStoreWorkPlan workPlan) {
        SimpleDateFormat dateFormat = new SimpleDateFormat("HH:mm");

        this.id = workPlan.getId();
        this.storeId = workPlan.getStoreId();
        this.storeCode = workPlan.getStoreCode();
        //早班开始时间
        if(StringUtils.isEmpty(workPlan.getMorningShiftStartTime())){
            this.morningShiftStartTime = "";
        }else {
            this.morningShiftStartTime = dateFormat.format(workPlan.getMorningShiftStartTime());
        }
        //早班结束时间
        if(StringUtils.isEmpty(workPlan.getMorningShiftEndTime())){
            this.morningShiftEndTime = "";
        }else {
            this.morningShiftEndTime = dateFormat.format(workPlan.getMorningShiftEndTime());
        }
        //晚班开始时间
        if(StringUtils.isEmpty(workPlan.getNightShiftStartTime())){
            this.nightShiftStartTime = "";
        }else {
            this.nightShiftStartTime = dateFormat.format(workPlan.getNightShiftStartTime());
        }
        //晚班结束时间
        if(StringUtils.isEmpty(workPlan.getNightShiftEndTime())){
            this.nightShiftEndTime = "";
        }else {
            this.nightShiftEndTime = dateFormat.format(workPlan.getNightShiftEndTime());
        }
        //全班开始时间
        if(StringUtils.isEmpty(workPlan.getAllDayShiftStartTime())){
            this.allDayShiftStartTime = "";
        }else {
            this.allDayShiftStartTime = dateFormat.format(workPlan.getAllDayShiftStartTime());
        }
        //全班结束时间
        if(StringUtils.isEmpty(workPlan.getAllDayShiftEndTime())){
            this.allDayShiftEndTime = "";
        }else {
            this.allDayShiftEndTime = dateFormat.format(workPlan.getAllDayShiftEndTime());
        }
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getStoreId() {
        return storeId;
    }

    public void setStoreId(Long storeId) {
        this.storeId = storeId;
    }

    public String getMorningShiftStartTime() {
        return morningShiftStartTime;
    }

    public void setMorningShiftStartTime(String morningShiftStartTime) {
        this.morningShiftStartTime = morningShiftStartTime;
    }

    public String getMorningShiftEndTime() {
        return morningShiftEndTime;
    }

    public void setMorningShiftEndTime(String morningShiftEndTime) {
        this.morningShiftEndTime = morningShiftEndTime;
    }

    public String getNightShiftStartTime() {
        return nightShiftStartTime;
    }

    public void setNightShiftStartTime(String nightShiftStartTime) {
        this.nightShiftStartTime = nightShiftStartTime;
    }

    public String getNightShiftEndTime() {
        return nightShiftEndTime;
    }

    public void setNightShiftEndTime(String nightShiftEndTime) {
        this.nightShiftEndTime = nightShiftEndTime;
    }

    public String getAllDayShiftStartTime() {
        return allDayShiftStartTime;
    }

    public void setAllDayShiftStartTime(String allDayShiftStartTime) {
        this.allDayShiftStartTime = allDayShiftStartTime;
    }

    public String getAllDayShiftEndTime() {
        return allDayShiftEndTime;
    }

    public void setAllDayShiftEndTime(String allDayShiftEndTime) {
        this.allDayShiftEndTime = allDayShiftEndTime;
    }

    public Long getStoreCode() {
        return storeCode;
    }

    public void setStoreCode(Long storeCode) {
        this.storeCode = storeCode;
    }
}
